package com.atguigu.bigdata.scala.chapter08

object Scala01_Match_1 {

    def main(args: Array[String]): Unit = {
        // TODO - 模式匹配
        var a: Int = 10
        var b: Int = 20
        var operator: Char = '*'
        var result = operator match {
            case '+' => a + b
            case '-' => a - b
            case '*' => a * b
            case '/' => a / b
            case _ => "illegal"
        }
        println(result)
    }
}
